<!DOCTYPE html>
<html lang="zh" xmlns:th="http://thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>系统登录</title>
		<script th:src="@{/layui/layui.js}" type="text/javascript"></script>
		<link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
	</head>
	<!--　TODO 登录页面背景图片无法加载　-->
	<body th:style="'background:url(../img/bg.jpg) no-repeat;'">
		<div id="div" style="margin: 0px auto;">
			<div class="layui-container" style="width: 500px;height: 450px;
				">
				<div class="layui-panel" style="width: 100%;height: 100%;border: 1px solid #009688;">
					<div style="text-align: center;font-size: 32pt;height: 55px;padding: 15px;" class="layui-bg-green ">
						登录界面
					</div>
					<div style="margin: 35px 20px;">
						<form class="layui-form layui-form-pane">
							<div class="layui-form-item">
								<label class="layui-form-label" style="height: 50px;padding-top: 15px;">登录名</label>
								<div class="layui-input-block">
									<input style="height: 50px;" class="layui-input" name="loginName" placeholder="输入登录名" autocomplete="off" />
								</div>
							</div>
							<div class="layui-form-item" >
								<label class="layui-form-label" style="height: 50px;padding-top: 15px;">密码</label>
								<div class="layui-input-block">
									<input style="height: 50px;" type="password" class="layui-input" name="password" placeholder="输入密码" autocomplete="off" />
								</div>
							</div>
							<div class="layui-form-item" >
								<div class="layui-inline">
									<label class="layui-form-label" style="height: 50px;padding-top: 15px;">验证码</label>
									<div class="layui-input-inline" style="width: 150px;">
										<input style="height: 50px;" type="text" class="layui-input" name="code" placeholder="输入验证码" autocomplete="off" />
									</div>
									<div class="layui-input-inline" style="width: 120px;">
										<a href='#'>
										<img src="" style="height: 50px; width: 120px;" />
										</a>
									</div>
								</div>
								
							</div>
							<div class="layui-form-item" >
								<div class="">
									<a class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="loginBtn" style="height: 50px;padding: 5px;font-size: 20px;">
										<i class="layui-icon layui-icon-set"></i>
										登陆
									</a>
								</div>
							</div>
						</form>
						<hr>
						<div style="text-align: right;">
							<a th:href="@{/page/forgetPwd}" class="" style="color: #009688;">
							忘记密码......
							</a>
						</div>	
					</div>
				</div>
			</div>	
		</div>	
		<script>
			var $;
			layui.use(['form','jquery','layer'],function(){
				var form = layui.form,layer = layui.layer;
				$ = layui.jquery;
				
				$('#div').css({'position':'absolute','top':($(window).height()-450)/2,'left':($(window).width()-500)/2})
		    	$(window).resize(function(){
		    		$('#div').css({'position':'absolute','top':($(window).height()-450)/2,'left':($(window).width()-500)/2})
		    	})

				/*登录按钮点击事件*/
				form.on('submit(loginBtn)',function (obj) {
					var data = obj.field;
					$.ajax({
						type:'post',
						url:'/system/lc/login',
						data:data,
						dataType:'json',
						success:function (result) {
							layer.msg(result.msg)
							if (result.is){
								//页面跳转
								window.location.href = '/page/index';
							}
						}
					})
				})
			})
			
			//获取页面高度
		    function setHeight(){
		    	
		    }
		</script>
	</body>
</html>
